<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="description" content="">
	<meta name="author" content="">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
	<title>Potree Viewer</title>

	<link rel="stylesheet" type="text/css" href="../build/potree/potree.css">
	<link rel="stylesheet" type="text/css" href="../libs/jquery-ui/jquery-ui.min.css">
	<link rel="stylesheet" type="text/css" href="../libs/openlayers3/ol.css">
	<link rel="stylesheet" type="text/css" href="../libs/spectrum/spectrum.css">
	<link rel="stylesheet" type="text/css" href="../libs/jstree/themes/mixed/style.css">
</head>

<body>
	<script src="../libs/jquery/jquery-3.1.1.min.js"></script>
	<script src="../libs/spectrum/spectrum.js"></script>
	<script src="../libs/jquery-ui/jquery-ui.min.js"></script>
	<script src="../libs/three.js/build/three.min.js"></script>
	<script src="../libs/three.js/extra/lines.js"></script>
	<script src="../libs/other/BinaryHeap.js"></script>
	<script src="../libs/tween/tween.min.js"></script>
	<script src="../libs/d3/d3.js"></script>
	<script src="../libs/proj4/proj4.js"></script>
	<script src="../libs/openlayers3/ol.js"></script>
	<script src="../libs/i18next/i18next.js"></script>
	<script src="../libs/jstree/jstree.js"></script>
	<script src="../build/potree/potree.js"></script>
	<script src="../libs/plasio/js/laslaz.js"></script>
	
	<!-- INCLUDE ADDITIONAL DEPENDENCIES HERE -->
	<!-- INCLUDE SETTINGS HERE -->
	
	<div class="potree_container" style="position: absolute; width: 100%; height: 100%; left: 0px; top: 0px; ">
		<div id="potree_render_area" style="background-image: url('../build/potree/resources/images/background.jpg');"></div>
		<div id="potree_sidebar_container"> </div>
	</div>
	
	<script>
	
		window.viewer = new Potree.Viewer(document.getElementById("potree_render_area"));
		
		viewer.setEDLEnabled(true);
		viewer.setFOV(60);
		viewer.setPointBudget(1*1000*1000);
		viewer.setMinNodeSize(10);
		viewer.loadSettingsFromURL();
		
		viewer.setDescription(`Sorvilier point cloud courtesy of <a target='_blank' href='https://www.sigeom.ch/'>sigeom sa</a>`);
		
		viewer.loadGUI(() => {
			viewer.setLanguage('en');
			$("#menu_scene").next().show();
			$("#menu_tools").next().show();
			viewer.toggleSidebar();
		});
		
		// Sigeom
		Potree.loadPointCloud("../pointclouds/vol_total/cloud.js", "sigeom.sa", e => {
			viewer.scene.addPointCloud(e.pointcloud);
			
			let material = e.pointcloud.material;
			material.size = 1;
			material.pointSizeType = Potree.PointSizeType.ADAPTIVE;
			
			viewer.scene.view.position.set(589974.341, 231698.397, 986.146);
			viewer.scene.view.lookAt(new THREE.Vector3(589851.587, 231428.213, 715.634));
			// viewer.fitToScreen();
		});
		
		Potree.loadPointCloud("../pointclouds/lion_takanawa/cloud.js", "lion 1", e => {
			viewer.scene.addPointCloud(e.pointcloud);
			
			let material = e.pointcloud.material;
			material.size = 1;
			material.pointSizeType = Potree.PointSizeType.ADAPTIVE;
			
			e.pointcloud.position.set(589927.44, 231479.04, 726.87);
			e.pointcloud.scale.set(10, 10, 10);
			e.pointcloud.rotation.set(0, 0, 0.8 * Math.PI);
			//e.pointcloud.visible = false;
			// viewer.fitToScreen();
		});
		
		Potree.loadPointCloud("../pointclouds/lion_takanawa/cloud.js", "lion 2", e => {
			viewer.scene.addPointCloud(e.pointcloud);
			
			let material = e.pointcloud.material;
			material.size = 1;
			material.pointSizeType = Potree.PointSizeType.ADAPTIVE;
			material.activeAttributeName = "elevation";
			material.heightMin = 720;
			material.heightMax = 780;
			
			e.pointcloud.position.set(589997.44, 231479.04, 726.87);
			e.pointcloud.scale.set(10, 10, 10);
			e.pointcloud.rotation.set(0, 0, 0.8 * Math.PI);
			//e.pointcloud.visible = true;
			// viewer.fitToScreen();
		});
		
		Potree.loadPointCloud("../pointclouds/lion_takanawa/cloud.js", "lion 3", e => {
			viewer.scene.addPointCloud(e.pointcloud);
			
			let material = e.pointcloud.material;
			material.size = 1;
			material.pointSizeType = Potree.PointSizeType.ADAPTIVE;
			material.activeAttributeName = "rgba";
			material.color = new THREE.Color().setRGB(0.4, 0.6, 0.7);
			
			e.pointcloud.position.set(589927.44 -70, 231479.04, 726.87);
			e.pointcloud.scale.set(10, 10, 10);
			e.pointcloud.rotation.set(0, 0, 0.8 * Math.PI);
			e.pointcloud.visible = true;
			// viewer.fitToScreen();
		});

		Potree.loadPointCloud("http://5.9.65.151/mschuetz/potree/resources/pointclouds/archpro/heidentor/cloud.js", "Heidentor", function(e){
			viewer.scene.addPointCloud(e.pointcloud);
			
			e.pointcloud.position.set(589817.920, 231358.010, 744.865);
			e.pointcloud.scale.set(6, 6, 6);
			e.pointcloud.rotation.z = -1.9;

			let material = e.pointcloud.material;
			material.size = 1;
			material.pointSizeType = Potree.PointSizeType.ADAPTIVE;
		});

	</script>
	
	
  </body>
</html>
